function chunk(originArr, len)  {
    var arr = []
      
      for(let i = 0;i<originArr.length; i+=len){    //每次放入i到i+len长度的数组到新数组
        var install = originArr.slice(i,i+len)
        arr.push(install)
      }
    
      return arr
  };


  console.log(chunk(["a", "b", "c", "d", "e", "f",1,1,1,1,11,1],8));
  




  /**
 * @description
 * 将一个一维数组切分成二维数组，按照第二个参数（数字）的值，来决定二维数组长度
 * @example

 * const originArr = ['a', 'b', 'c', 'd']
 * const result = chunk(originArr, 3);
 * console.log(result) => [['a','b', 'c'], ['b']];
 * const result = chunk(originArr, 2);
 * console.log(result) => [['a','b'], ['c','b']];
 * const result = chunk(originArr, 1);
 * console.log(result) => [['a‘],['b‘],['c‘],['d']];
 *
 * 你需要实现这个 chunk 方法。
 */

export const chunk = (originArr, len) => {
    var arr = []
      
      for(let i = 0;i<originArr.length; i+=len){    //每次放入i到i+len长度的数组到新数组
        var install = originArr.slice(i,i+len)
        arr.push(install)
      }
    
      return arr
  };
  
  